package ma.cdm.compteRenduVO;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;

public class PieceJointeVO implements Externalizable, Serializable {
	private String fileName;
	private String filePath;
	private byte[] file;
	private Integer fileSize;
	private String fileType;
	
	
	
	
	public PieceJointeVO() {
		super();
	}



	public PieceJointeVO(String fileName, byte[] file, Integer fileSize,
			String fileType) {
		super();
		this.fileName = fileName;
		this.file = file;
		this.fileSize = fileSize;
		this.fileType = fileType;
	}



	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public byte[] getFile() {
		return file;
	}

	public void setFile(byte[] file) {
		this.file = file;
	}

	public Integer getFileSize() {
		return fileSize;
	}

	public void setFileSize(Integer fileSize) {
		this.fileSize = fileSize;
	}

	public void writeExternal(ObjectOutput output) throws IOException {
		 output.writeObject(file);
         output.writeObject(fileName);
         output.writeObject(filePath);
         output.writeObject(fileSize);
         output.writeObject(fileType);

	}

	public void readExternal(ObjectInput input) throws IOException,
			ClassNotFoundException {
		file = (byte[])input.readObject() ;
        fileName =(String) input.readObject();
        filePath = (String)input.readObject();
        fileSize = (Integer)input.readObject();
        fileType =(String) input.readObject();
	}

}
